<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2812：世界树</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">世界树</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">世界树</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                世界树                </h1>
                <p>时间限制：20s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：512MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div style="margin: 13pt 0cm"><span style="font-size: medium"><br />
</span></div>
<div><span style="font-size: medium">世界之树，又称&ldquo;乾坤树&rdquo;。在北欧神话中，巨大的树干构成了整个世界。</span></div>
<div><span style="font-size: medium">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &mdash;&mdash;百度百科</span></div>
<div style="margin: 0cm 0cm 0pt 23.95pt"><span style="font-size: medium">世界树由n个节点构成，共有n-1条枝干连接，任意两个节点都可以互相到达。这一天，主神奥丁准备视察一些树上的种族（比如精灵族，神族，海族，兽族，不死族，还有人族）。但是奥丁只想视察树上的一条路径（不能重复地经过某条枝干），由于他的某种特殊爱好，他还要求路径长度不超过R，且不低于L。已知每条枝干都有一个美丽度，奥丁希望自己视察的路径的美丽度的平均值尽可能地大。</span></div>
<div style="margin: 0cm 0cm 0pt 23.95pt"><span style="font-size: medium">路径美丽度的平均值定义为：将路径上所有枝干的美丽度从小到大排序后，第Trunc(Len/2)+1个美丽度，len指这一条路径的长度。</span></div>
<div style="margin: 0cm 0cm 0pt 23.95pt"><span style="font-size: medium">请你告诉奥丁，他的路径应该从哪个节点出发，到哪个节点结束。</span></div></p><hr/><h3>输入格式</h3><p><div><span style="font-size: medium">第一行三个整数：n,L,R</span></div>
<div><span style="font-size: medium">接下来n-1行：</span></div>
<div><span style="font-size: medium">每行三个整数：x, y, z</span></div>
<div><span style="font-size: medium">代表一条连接x节点和y节点的枝干，美丽度为z</span></div></p><hr/><h3>输出格式</h3><p><div><span style="font-size: medium">输出两个节点u,v，表示从u出发，v结束美丽度最大。</span></div>
<div><span style="font-size: medium">如果有多组答案，任意输出一组。</span></div></p><hr/><h3>样例输入</h3><pre>10  2  5
2  1  0
3  2  10
4  2  5
5  3  1
6  4  5
7  3  10
8  6  10
9  6  12
10  5  0
</pre><hr/><h3>样例输出</h3><pre>8 9</pre><hr/><h3>提示</h3><p><p><br />
【数据规模及约定】<br />
对于30%的数据保证：n &lt;= 1000<br />
对于100%的数据保证：n &lt;= 100000，1 &lt;= L &lt;= R &lt;= n-1，1 &lt;= x,y &lt;= n，<br />
0 &lt;= z &lt; 2^31，数据保证有解。<br />
请尽量优化常数。</p>
<p></p>
<p><span style="color: rgb(255, 0, 0);">SPJ程序有误，请不要提交!</span></p></p><hr/><h3>题目来源</h3><p>没有写明来源</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2812" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2812" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>